function importPlan() {
	$("#file").trigger("click");
}

function getFilePath(){  
	$("#fileForm").submit();
}

function query() {
	var startDate = $.trim($("#startDate").val());
	var endDate = $.trim($("#endDate").val());
	var userName = $.trim($("#userName").val());
	var planName = $.trim($("#planName").val());
	
	$.post(ctx + "plan/page", {
		startDate: startDate,
		endDate: endDate,
		userName: userName,
		planName: planName
	}, function(data) {
		$("#tbody").empty();
		if(data && data.length > 0) {
			var tr = [];
			for(var i = 0; i < data.length; i++) {
				var o = data[i];
				tr.push("<tr>");
				tr.push("<td>" + (i + 1) + "</td>");
				tr.push("<td>" + o.planDateStr + "</td>");
				tr.push("<td>" + o.userId + "</td>");
				tr.push("<td>" + o.userName + "</td>");
				tr.push("<td>" + o.userDept + "</td>");
				tr.push("<td>" + o.planName + "</td>");
				tr.push("<td>" + o.count + "</td>");
				tr.push('<td><a class="oper-btn" href="javascript:modifyPlan(\'' + o.planId + '\')">修改</a></td>');
				tr.push("</tr>");
			}
			$("#tbody").html(tr.join(""));
		}
	}, 'json');
}

function modifyPlan(planId) {
	window.open(ctx + 'plan/modifyView/' + planId);
}